package com.quartet.modules.alarm.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.quartet.modules.alarm.dto.TTerminalRealAlarmInfoResponseDto;
import com.quartet.modules.alarm.dto.TVehicleAlarmInfoStatisticsDto;
import com.quartet.modules.alarm.dto.TVehicleSecurityAlarmProcessingResponseDto;
import com.quartet.modules.alarm.entity.TTerminalAlarm;
import com.quartet.modules.platform.dto.TTerminalAlarmTimeCount;
import com.quartet.modules.platform.dto.TTerminalNumberDto;
import com.quartet.modules.platform.dto.vo.AlarmCountGroupTimeDataVo;
import com.quartet.modules.platform.dto.vo.AlarmCountGroupTypeDataVo;
import com.quartet.modules.statistics.dto.AlarmStatisticsRequestDto;
import com.quartet.modules.statistics.dto.AlarmStatisticsResponseDto;
import com.quartet.modules.vehicle.dto.TVehicleRealAlarmInfoRequestDto;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 其他报警信息表(TOtherAlarmInfo)表数据库访问层
 *
 * @author makejava
 * @since 2021-05-18 09:44:34
 */
public interface TTerminalAlarmInfoDao extends BaseMapper<TTerminalAlarm> {

    /**
     * 统计其他报警的信息
     *
     * @param tVehicleRealAlarmInfoRequestDto
     * @return
     */
    List<TVehicleAlarmInfoStatisticsDto> selectOtherAlarmStatisticsList(TVehicleRealAlarmInfoRequestDto tVehicleRealAlarmInfoRequestDto);

    /**
     * 功能描述: 查询未处理的报警信息
     *
     * @param tVehicleRealAlarmInfoRequestDto
     * @return java.util.List<com.quartet.modules.equipment.entity.TAlarmProcessingInfo>
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/6/3 13:56
     */
    List<TVehicleSecurityAlarmProcessingResponseDto> selectSecurityAlarmProcessingList(TVehicleRealAlarmInfoRequestDto tVehicleRealAlarmInfoRequestDto);

    /**
     * 查询实时报警数据
     *
     * @param tVehicleRealAlarmInfoRequestDto
     * @return
     */
    List<TTerminalRealAlarmInfoResponseDto> selectOtherRealAlarmList(TVehicleRealAlarmInfoRequestDto tVehicleRealAlarmInfoRequestDto);

    /**
     * 主键获取报警信息
     *
     * @param id
     * @return
     */
    TTerminalRealAlarmInfoResponseDto getAlarmInfoById(Integer id);

    /**
     * 获取未读报警消息
     *
     * @return
     */
    List<TTerminalRealAlarmInfoResponseDto> selectTerminalRealAlarmList(@Param("warningMarkList") List<String> warningMarkList);

    /**
     * 批量修改告警信息状态
     *
     * @param idList
     */
    void updateTerminalAlarmStatus(@Param("idList") List<Integer> idList);

    /**
     * 功能描述: 获取过去一周的报警信息
     *
     * @param startTime
     * @return java.util.List<com.quartet.modules.vehicle.dto.TTerminalPositionInfoResponseDto>
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/6/23 17:20
     */
    List<TTerminalAlarmTimeCount> getAlarmInfoLastWeek(@Param("tTerminalCodeList") List<String> tTerminalCodeList,@Param("startTime") LocalDateTime startTime, @Param("warningMarkList") List<String> warningMarkList);

    /**
     *  获取近七天的在线设备数
     * @param startTime
     * @return
     */
    List<TTerminalNumberDto> getOnlineTerminalLastWeek(@Param("tTerminalCodeList") List<String> tTerminalCodeList,@Param("startTime") LocalDateTime startTime,@Param("type") Integer type);
    /**
     *  获取近一年的在线设备数
     * @param startTime
     * @return
     */
    List<TTerminalNumberDto> getOnlineTerminalLastYear(@Param("tTerminalCodeList") List<String> tTerminalCodeList,@Param("startTime") LocalDateTime startTime,@Param("type") Integer type);

    /**
     * 按小时查询报警次数
     * @param alarmStatisticsRequestDto
     * @return
     */
    List<AlarmStatisticsResponseDto> queryServiceStatisticsDataWithHour(AlarmStatisticsRequestDto alarmStatisticsRequestDto);

    /**
     * 按天查询报警次数
     * @param alarmStatisticsRequestDto
     * @return
     */
    List<AlarmStatisticsResponseDto> queryServiceStatisticsDataWithDay(AlarmStatisticsRequestDto alarmStatisticsRequestDto);
    /**
     * 查询报警总数
     * @return
     */
    Integer queryAlarmCount();

    /**
     * 查询报警分类个数
     * @return
     */
    List<AlarmCountGroupTypeDataVo> queryAlarmCountGroupByAlarm();

    /**
     * 查询近24小时的报警个数
     * @param startTime
     * @return
     */
    List<AlarmCountGroupTimeDataVo> queryAlarmCountGroupTime(@Param("startTime") LocalDateTime startTime);

    /**
     * 按照报警类型分组查询报警个数
     * @param alarmStatisticsRequestDto
     * @return
     */
    List<AlarmCountGroupTypeDataVo> queryAlarmCountGroupType(AlarmStatisticsRequestDto alarmStatisticsRequestDto);

    /**
     * 功能描述: 按月查询报警次数
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/11/11 20:57
     * @param alarmStatisticsRequestDto
     * @return java.util.List<com.quartet.modules.statistics.dto.AlarmStatisticsResponseDto>
     */
    List<AlarmStatisticsResponseDto> queryServiceStatisticsDataWithMonth(AlarmStatisticsRequestDto alarmStatisticsRequestDto);

    /**
     *  分页查询报警信息
     * @param alarmStatisticsRequestDto
     * @return
     */
//    List<TTerminalRealAlarmInfoResponseDto> queryAlarmStatisticsList(AlarmStatisticsRequestDto alarmStatisticsRequestDto);
}